package com.tuanbiao.models.action;

import com.hzjq.data.callback.Callback;
import com.hzjq.lib.BlastKool;
import com.hzjq.lib.callback.NettedCallback;
import com.tuanbiao.data.callback.OnBaseResultCallback;

import timber.log.Timber;

/**
 * @author abiao
 * @since 2022/4/26 11:52
 * 组网
 */
public interface NettedAction {
    default void netted(NettedCallback callback) {
        BlastKool.Companion.loader().netted().quick(callback);
    }

    default void cancelNetted() {
        Timber.i("cancelNetted");
        BlastKool.Companion.loader().netted().cancel();
        BlastKool.Companion.loader().authTimer().cancel();
        BlastKool.Companion.loader().delayTimer().cancel();
    }

    default void exitNetted(OnBaseResultCallback<Boolean> callback) {
        Timber.i("exitNette");
        BlastKool.Companion.loader().netted().exitNett(aBoolean -> {
            Timber.i("exitNetted:"+aBoolean);
            callback.onSuccess(aBoolean);
            callback.onFinish();
        });
    }
}
